#include "npy.hpp"
#include <vector>
#include <string>
#include <iostream>

template<class T>
void printV(const std::vector<T>& data){
  for(const auto& val :data){
    std::cout<< val<<" ";
  }
  std::cout<<std::endl;
}

int main() {

  npy::npy_data<int> array_int = npy::read_npy<int>("python_int.npy");
  npy::npy_data<float> array_float = npy::read_npy<float>("python_float.npy");
  npy::npy_data<float> cplus_float2 = npy::read_npy<float>("cplus_float.npy");
  printf("similarity:%f\n",get_cosine_similarity(array_int.data,array_float.data));
  printf("similarity2:%f\n",get_cosine_similarity(cplus_float2.data,array_float.data));



  npy::npy_data<int> cplus_int;
  cplus_int.data = std::vector<int>{20, 21, 31, 41, 51, 61, 71, 81};
  cplus_int.shape = {2, 4};
  write_npy("cplus_int.npy", cplus_int);

  npy::npy_data<float> cplus_float;
  cplus_float.data = std::vector<float>{20.9, 21.5, 31, 41, 51, 61, 71, 81};
  cplus_float.shape = {2, 4};
  write_npy("cplus_float.npy", cplus_float);
  printf("cplus similarity:%f\n",get_cosine_similarity(cplus_int.data,cplus_float.data));

//  std::vector<int> data = d.data;
//  std::vector<unsigned long> shape = d.shape;
//  bool fortran_order = d.fortran_order;

//  std::cout<<"shape:";
//  printV(shape);
//  std::cout<<"ndarray:";
//  printV(data);
  return 0;
}
